Re: 8lgm's SCO "at" hole

Steinar Haug (Steinar.Haug@runit.sintef.no)
Sat, 10 Dec 1994 08:30:48 +0100 (MET)

> AFAIK, getcwd(3) always calls /bin/pwd; but getwd(2) is a system call.
> getcwd() is only provided for backwards compatibility; i suppose all new
> code should be using getwd(2).

In SunOS 4.1.3 (and 4.1.2) they are both library functions. getcwd() uses
popen, as noted. getwd() traverses the path upwards by repeatedly opening 
the directory on the level above and reading directory entries until it 
gets a match for the current directory. It uses /etc/mtab to avoid hanging
across mount points that might be dead.

In HP-UX 9.05 getcwd() traverses the path upwards - it does *not* use 
popen(). getwd() doesn't exist.

POSIX wants you to use getcwd().

Steinar Haug, SINTEF RUNIT, University of Trondheim, NORWAY
Email: Steinar.Haug@runit.sintef.no